package contegor.scire.core;

import java.util.List;


/**
 * Interface for {@link Task}s that in their processing generate other {@link Task}s.
 * 
 * This are {@link Task}s that need to execute more logic than what they have in their
 * {@link Task#process(Container)} method to fulfill their work.
 * One reason can be they need elements in other {@link Container}s other than the one
 * they have as target. So they generate additional {@link Task}s that will be executed after their
 * {@link Task#process(Container)} method.
 *
 * @version $Revision$
 * @author  Héctor Cirbián Pousa ($Author$)
 */
@Version("$Id$")
public interface WithConsequences<I,O> extends Task<I> {

  /**
   * <b>Internal use only method. Don't call it directly.</b>
   * Returns a {@link List} with {@link Task}s consequence of this one.
   * Implementation notes:
   * If {@link Task}s with the same target are set consecutively, then they could be processed more effectively.
   */
  public List<? extends Task<O>> getConsequences();

  /**
   * <b>Internal use only method. Don't call it directly.</b>
   * Returns a {@link List} with this {@link Task} consequences {@link ReturnPoint}s. It must have the same number
   * of elements and this must be in sync with those in the {@link List} returned by {@link #getConsequences()},
   * so first {@link ReturnPoint} will correspond to first consequence {@link Task}, second to second, and so on.
   */
  public List<? extends ReturnPoint<? super O>> getConsequencesReturnPoints();
}
